home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / comm / comm5 / adprotam.lha / imagefx / Transfer_Anim.ifx < prev   
Text File  |  1997-01-08  |  5KB  |  145 lines

  1. /*
  2.  * Transfer_AnimPlus.ifx
  3.  *
  4.  * $VER: Transfer_AnimPlus.ifx 0.75 1.12.96
  5.  * 
  6.  * by Frank E Lahr E-Mail vtnt@newnorth.net
  7.  *
  8.  * This macro is a little different from the other TAM.ifx. This 
  9.  * macro will do more, but it does require a special program called 
  10.  * "ViewT"in your 'C:' directory.
  11.  * It will make an icon and the appropiate tooltypes for use with AWeb.
  12.  *
  13.  * This arexx/macro will load a sequence of images and tile them
  14.  * to make a transfer anim. The transfer anim can then be used with 
  15.  * certain web browsers.
  16.  * Thank you J.W. Wilson for your help. 
  17.  * And to Phil Dietz for his program "ViewT".
  18. */
  19.  
  20. OPTIONS RESULTS
  21.  
  22. directory = "AWEB-II:Storage/AWeb-A_TAM/mine/"
  23.  
  24. RequestFile '"Pick a image file..."' directory '""' '#?'
  25. IF rc ~= 0 THEN EXIT 0
  26. fullfilepath = result
  27.  
  28. finddot = FIND(fullfilepath,'.')                /* Look for the '.' in image filepath   */
  29. IF finddot = '' THEN DO
  30.     RequestNotify 'The file you selected is not indexed correctly' 
  31.     EXIT
  32.     END
  33. ELSE
  34.     filelength = length(fullfilepath)             /* How long is the filepath             */
  35.     dot = lastpos('.', fullfilepath) -1         /* Find position of '.' in the filepath */
  36.     index = filelength - dot                    /* Do the math for the index offset     */
  37.     fileindex = RIGHT(fullfilepath,index)        /* Define the index from the filepath     */
  38.  
  39.     checkindex = VERIFY(fileindex,'.0123456789')    /* Checks index to see if it's numeric    */
  40.         IF checkindex ~= 0 THEN DO 
  41.         RequestNotify 'The file you selected is not indexed correctly' 
  42.         EXIT
  43. END
  44.  
  45. findslash = FIND(fullfilepath,'/')                /* Look for the '/' in image filepath     */
  46. IF findslash = '' THEN DO                    /* If '/' not there,                */
  47.     findcolon = FIND(fullfilepath,':')            /* look for ':'.                    */
  48.     IF findcolon = '' THEN EXIT
  49.     ELSE
  50.         colon = lastpos(':', fullfilepath)        /* Find ':' in image filepath              */
  51.         file = filelength - colon            /* Do the math for the file offset     */
  52.         filename = RIGHT(fullfilepath,file)    /* Define the file from the filepath    */
  53.     END
  54. ELSE
  55. slash = lastpos('/', fullfilepath)        /* Find position of '/' in the filepath */
  56. file = filelength - slash            /* Do the math for the file offset     */
  57. filename = RIGHT(fullfilepath,file)    /* Define the file from the filepath    */
  58.  
  59.  
  60. name = lastpos('.', filename)    -1        /* Find position of '.' in filename    */
  61. justname = LEFT(filename,name)        /* Define just name from filename        */
  62.                                 
  63. path = LEFT(fullfilepath,slash)        /* Defines the path from the filepath    */ 
  64. directory = path                    /* Sets directory path for requester    */
  65. CALL SETCLIP('TAM_Dir', directory)        /* Sets variable for source directory    */
  66.     
  67. /* next make a temp file of the image and associated indexed files to be called later */
  68.  
  69. ADDRESS COMMAND 'c:LIST 'path||justname||'#? TO RAM:tam.temp NOHEAD QUICK'
  70. IF rc ~= 0 THEN DO
  71.    RequestNotify 'Error listing image files.'
  72.    EXIT
  73. END
  74.  
  75. /* sort alphabetically */
  76. ADDRESS COMMAND 'c:Sort RAM:tam.temp TO RAM:tamlist.temp'
  77. ADDRESS COMMAND 'c:Delete RAM:tam.temp QUIET'
  78.  
  79. wdtotal = 0
  80. IF ~OPEN(infile, 'Ram:tamlist.temp', 'Read') THEN DO
  81.    RequestNotify 'Cannot read image files.'
  82. END
  83. ELSE
  84.    DO UNTIL EOF(infile)
  85.        wdtotal = wdtotal + Words(READLN(infile))
  86. END
  87. Close(infile)
  88. tooltypeframes = wdtotal
  89.  
  90. Undo Off
  91. /* More ImageFX commands */
  92.  
  93. LoadBuffer fullfilepath force                    /* Load first image            */
  94. GetMain                                    /* Get image stats which are  */
  95. IF result = "" THEN EXIT                     /* name,width,height &  depth */
  96.     PARSE VAR result name fwidth fheight depth    /* Break down the variables   */
  97. tooltypesizex = fwidth
  98. tooltypesizey = fheight
  99.  
  100. SWAP                                        /* Put image into swap (bg)    */
  101. newfwidth = fwidth * wdtotal                    /* Define new image dimensions*/
  102. CreateBuffer newfwidth fheight force            /* Create new image based on  */
  103.                                         /* first image and expanded y */
  104. SWAP
  105. wdtotal = 0                                /* Line number of list images */
  106. fwidth = fwidth - fwidth - fwidth                /* Define roll amount         */
  107.  
  108. Open(infile, 'Ram:tamlist.temp')                /* Open list of image files    */
  109. DO UNTIL EOF(infile)
  110.     imagefile = READLN(infile)                /* Read image file            */
  111.      fullfilepath = path||imagefile            /* Add path to image file    */
  112.     LoadBuffer fullfilepath force                /* Load image file into IFX   */
  113.         If rc ~=0 THEN LEAVE
  114.     SWAP                                    /* Put image file into swap    */
  115.     SwapToBrush                            /* Make swap image into brush    */
  116.     BrushHandle 0 0                        /* Handle brush at 0x,0y        */
  117.     NewArea                                /* Clear previous area        */
  118.     AddArea 0 0                            /* Define where to put image  */ 
  119.     FreeDraw                                /* Draw into main buffer        */
  120.     Region Full                            /* Select tool type    (brush)    */
  121.     KillBrush                                /* Free memory of brush        */
  122.     Roll fwidth 0                            /* Move image to the left    */
  123.     SWAP
  124. END
  125. Close(infile)                                /* Close list of image files    */
  126. SWAP
  127.  
  128. icon = "env:sys/def_tool.info"        /* Set variable to use this icon           */
  129. iconname = "def_tool"                /* Set var name from previous icon         */
  130. destination = "Ram:"                /* Set var path as to where to save the icon */
  131.  
  132. ADDRESS COMMAND 
  133. 'c:copy 'icon' TO 'destination
  134. 'c:viewt 'destination||iconname' add "SIZE='tooltypesizex','tooltypesizey'"'
  135. 'c:viewt 'destination||iconname' add "FIRST=0,0"'
  136. 'c:viewt 'destination||iconname' add "FRAMES='tooltypeframes'"'
  137. 'c:viewt 'destination||iconname' add "DELTA='tooltypesizex',0"'
  138. 'c:viewt 'destination||iconname' add "REST=0,0"'
  139. 'c:rename 'destination||iconname'.info TO Ram:def_transferanim.info'
  140. 'c:Delete Ram:tamlist.temp' 
  141. EXIT
  142.  
  143.  
  144.  
  145.